package net.telesing.tcmc.common;

import net.telesing.tcmc.back.model.UserModel;
import org.nutz.dao.entity.annotation.ColDefine;
import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.One;
import org.nutz.dao.entity.annotation.Readonly;

import java.sql.Timestamp;

/**
 * BaseModel，供model继承
 *
 * Created by Zmt on 2015/11/3.
 */
public class BaseModel extends IdModel
{
    @Column("CRT_USER")
    @ColDefine(update = false)//更新时无法修改
    private Long createUserId;

    @Column("creator_name")
    @Readonly
    private String creatorName;

    @One(target = UserModel.class, field = "createUserId")
    private UserModel createUser;

    @Column("CRT_TIME")
    @Readonly
    @ColDefine(update = false)//更新时无法修改
    private Timestamp createTime;

    @Column("UPT_USER")
    private Long updateUserId;

    @Column("updater_name")
    @Readonly
    private String updaterName;

    @One(target = UserModel.class, field = "updateUserId")
    private UserModel updateUser;

    @Column("UPT_TIME")
    @Readonly
    private Timestamp updateTime;

    public Long getCreateUserId()
    {
        return createUserId;
    }

    public void setCreateUserId(Long createUserId)
    {
        this.createUserId = createUserId;
    }

    public String getCreatorName()
    {
        return creatorName;
    }

    public void setCreatorName(String creatorName)
    {
        this.creatorName = creatorName;
    }

    public UserModel getCreateUser()
    {
        return createUser;
    }

    public void setCreateUser(UserModel createUser)
    {
        this.createUser = createUser;
    }

    public Timestamp getCreateTime()
    {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime)
    {
        this.createTime = createTime;
    }

    public Long getUpdateUserId()
    {
        return updateUserId;
    }

    public void setUpdateUserId(Long updateUserId)
    {
        this.updateUserId = updateUserId;
    }

    public String getUpdaterName()
    {
        return updaterName;
    }

    public void setUpdaterName(String updaterName)
    {
        this.updaterName = updaterName;
    }

    public UserModel getUpdateUser()
    {
        return updateUser;
    }

    public void setUpdateUser(UserModel updateUser)
    {
        this.updateUser = updateUser;
    }

    public Timestamp getUpdateTime()
    {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime)
    {
        this.updateTime = updateTime;
    }
}
